// run: $exec < input
#include <iostream>
#include <algorithm>
#include <queue>
#include <cmath>

int const maxn = 1007;
double const eps = 1e-5;
int a[maxn];
int b[maxn];
int n, k;

double calc(double mid)
{
	std::priority_queue<double> pq;
	for (int i = 0; i < n; i++)
		pq.push(a[i] - mid * b[i]);
	double ret = 0;
	for (int i = 0; i < n - k; i++) {
		ret += pq.top();
		pq.pop();
	}
	return ret;
}

int main()
{
	while (std::cin >> n >> k && (n || k)) {
		for (int i = 0; i < n; i++) std::cin >> a[i];
		for (int i = 0; i < n; i++) std::cin >> b[i];
		double l = 0, r = 0;
		for (int i = 0; i < n; i++)
			r = std::max(r, double(a[i]) / b[i]);
		while (l + eps < r) {
			double mid = (l + r) / 2.0;
			if (calc(mid) >= 0) l = mid;
			else r = mid;
		}
		std::cout << round(l * 100.0) << '\n';
	}
}

